// 用于配置对应路由
let express = require('express')
let categoryquery = require('../api/category_query')
let router = express.Router();
router.use(express.json());
router.use(express.urlencoded({
    extended: true
}));

// //获取所有分类信息
router.get('/', function (req, res) {
    res.redirect('/categorys'); // 重定向
});
router.get('/categorys', (req, res) => {
    categoryquery.getall(function (rec) {
        res.json(rec).end();
    });
});

module.exports = router